﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Reporting.WebForms;

namespace MvcReportViewer.Reports.EstMantenimiento
{
    public partial class Reporte : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //Worksround for a bug displaying report viewer control in a content placeholder
            //Response.Write("<div style=\"display:none\"></div>");
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            //ReportParameter p = new
            //          ReportParameter("BienInformaticoId", TextBox1.Text);
            //this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { p });

            List<ReportParameter> paramList = new List<ReportParameter>();

            paramList.Add(new ReportParameter("BienInformaticoId", TextBox1.Text, false));
            paramList.Add(new ReportParameter("dfim", TextBox2.Text, false));
            paramList.Add(new ReportParameter("dffm", TextBox3.Text, false));

            this.ReportViewer1.LocalReport.SetParameters(paramList);

            this.ReportViewer1.LocalReport.Refresh();
        }
    }
}
